package design.pay;

import design.mode.IPayMode;

import java.math.BigDecimal;

/**
 * @author: hero生仔
 */
public class ZfbPay extends Pay{
    public ZfbPay(IPayMode payMode) {
        super(payMode);
    }

    @Override
    public String transfer(String uId, String tradeId, BigDecimal amount) {
        System.out.println("模拟支付宝渠道支付划账开始。uId：" + uId + "tradeId：" + tradeId + "amount：" + amount);
        boolean security = payMode.security(uId);
        System.out.println("模拟支付宝渠道支付风控校验。uId：" + uId + " tradeId：" + tradeId + "security" + security);
        if (!security) {
            System.out.println("模拟支付宝渠道支付划账拦截。uId：" + uId + "tradeId：" + tradeId + "amount：" + amount);
            return "0001";
        }
        System.out.println("模拟支付宝渠道支付划账成功。uId：" + uId + "tradeId：" + tradeId + "amount：" + amount);
        return "0000";
    }
}
